package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourceMemberDataInfoTempMapper;
import com.ruoyi.db.domain.SourceMemberDataInfoTemp;
import com.ruoyi.source.service.ISourceMemberDataInfoTempService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索用户资质信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceMemberDataInfoTempServiceImpl implements ISourceMemberDataInfoTempService 
{
    @Autowired
    private SourceMemberDataInfoTempMapper sourceMemberDataInfoTempMapper;

    /**
     * 查询线索用户资质信息
     * 
     * @param id 线索用户资质信息主键
     * @return 线索用户资质信息
     */
    @Override
    public SourceMemberDataInfoTemp selectSourceMemberDataInfoTempById(Long id)
    {
        return sourceMemberDataInfoTempMapper.selectSourceMemberDataInfoTempById(id);
    }

    /**
     * 查询线索用户资质信息列表
     * 
     * @param sourceMemberDataInfoTemp 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<SourceMemberDataInfoTemp> selectSourceMemberDataInfoTempList(SourceMemberDataInfoTemp sourceMemberDataInfoTemp)
    {
        return sourceMemberDataInfoTempMapper.selectSourceMemberDataInfoTempList(sourceMemberDataInfoTemp);
    }

    /**
     * 查询线索用户资质信息列表
     *
     * @param sourceMemberDataInfoTemp 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<Map<String, Object>> selectSourceMemberDataInfoTempListMap(SourceMemberDataInfoTemp sourceMemberDataInfoTemp)
    {
        return sourceMemberDataInfoTempMapper.selectSourceMemberDataInfoTempListMap(sourceMemberDataInfoTemp);
    }

    /**
     * 新增线索用户资质信息
     * 
     * @param sourceMemberDataInfoTemp 线索用户资质信息
     * @return 结果
     */
    @Override
    public int insertSourceMemberDataInfoTemp(SourceMemberDataInfoTemp sourceMemberDataInfoTemp)
    {
        sourceMemberDataInfoTemp.setCreateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoTempMapper.insertSourceMemberDataInfoTemp(sourceMemberDataInfoTemp);
    }

    /**
     * 修改线索用户资质信息
     * 
     * @param sourceMemberDataInfoTemp 线索用户资质信息
     * @return 结果
     */
    @Override
    public int updateSourceMemberDataInfoTemp(SourceMemberDataInfoTemp sourceMemberDataInfoTemp)
    {
        sourceMemberDataInfoTemp.setUpdateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoTempMapper.updateSourceMemberDataInfoTemp(sourceMemberDataInfoTemp);
    }

    /**
     * 批量删除线索用户资质信息
     * 
     * @param ids 需要删除的线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoTempByIds(String ids)
    {
        return sourceMemberDataInfoTempMapper.deleteSourceMemberDataInfoTempByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索用户资质信息信息
     * 
     * @param id 线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoTempById(Long id)
    {
        return sourceMemberDataInfoTempMapper.deleteSourceMemberDataInfoTempById(id);
    }
}
